#ifndef INADDR_H
#define INADDR_H

#pragma once
#include <arpa/inet.h>
#include <string>
class SockAddrIn
{

public:
    SockAddrIn(const char* ip, unsigned short port, int family = AF_INET);
    SockAddrIn();
    ~SockAddrIn();
    sockaddr* getAddr() { return (sockaddr*)(&addr); }
    int getPort() {
        return ntohs(addr.sin_port);
    }
    std::string getIp();
private:
    struct sockaddr_in addr;
};

#endif